home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Treccani Italiana Di Scienze Lettere Ed Arti
/
[Enciclopedia] Treccani Italiana di scienze lettere ed arti.iso
/
pc
/
data
/
xxi_appendice_dvd.swf
/
scripts
/
__Packages
/
CenteredScrollPane.as
< prev
next >
Wrap
Text File
|
2007-11-08
|
2KB
|
58 lines
class CenteredScrollPane extends mx.containers.ScrollPane
{
static var symbolName = "CenteredScrollPane";
static var symbolOwner = CenteredScrollPane;
var className = "CenteredScrollPane";
function CenteredScrollPane()
{
super();
this.dummyPreview._visible = false;
}
function size()
{
super.size();
var _loc3_ = undefined;
var _loc4_ = undefined;
var _loc6_ = this.__get__maxHPosition();
var _loc5_ = this.__get__maxVPosition();
if(this.spContentHolder._width > this.__width)
{
_loc3_ = this.hPosition / _loc6_;
this.__set__hScrollPolicy("on");
if(_loc6_ == 0)
{
_loc3_ = this.__get__maxHPosition() / 2 << 0;
}
else
{
_loc3_ = _loc3_ * this.__get__maxHPosition() << 0;
}
}
else
{
this.__set__hScrollPolicy("off");
_loc3_ = - (this.__width - this.spContentHolder._width) / 2 << 0;
}
if(this.spContentHolder._height > this.__height)
{
_loc4_ = this.vPosition / _loc5_;
this.__set__vScrollPolicy("on");
if(_loc5_ == 0)
{
_loc4_ = this.__get__maxVPosition() / 2 << 0;
}
else
{
_loc4_ = _loc4_ * this.__get__maxVPosition() << 0;
}
}
else
{
this.__set__vScrollPolicy("off");
_loc4_ = - (this.__height - this.spContentHolder._height) / 2 << 0;
}
this.setHPosition(_loc3_);
this.setVPosition(_loc4_);
}
}